﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace HQWeb.View
{
    /// <summary>
    /// CheckProject 的摘要说明
    /// </summary>
    public class CheckProject : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string strIDs=context.Request["id"];
            BLL.SysManage.T_PUB_PROJECTTYPE typeBll = new BLL.SysManage.T_PUB_PROJECTTYPE();
            List<string> nowPath = typeBll.GetProjectTypePath(strIDs);
            List<Model.SysManage.T_PUB_PROJECTTYPE> notNullList = typeBll.GetNotNullList();
            string strPath;
            string strTemp;
            string strAlter="";
            foreach (Model.SysManage.T_PUB_PROJECTTYPE item in notNullList)
            {
                strPath = item.IDPATH;
                strTemp = nowPath.Find(p => p.Contains(strPath));
                if (string.IsNullOrEmpty(strTemp))
                {
                    strAlter = strAlter + item.PROJECTTYPE_NAME + " 未添加 \n";
                }
            }
       
            context.Response.Write(strAlter);
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}